package com.qf.flying;

import java.util.Random;
/**
 * 草稚京的制作-林梦雪
 * */

public class Cjj
        extends FlyObject
        implements Enemy
{
    private int Yspeed = 2;//速度


    public Cjj()
    {
        life = 100;
        totalLife = 100;
        image = ShootGame.cjj;//图片
        width = image.getWidth(); //宽度
        height = image.getHeight();//高度
        y = -height;//y坐标
        Random rand = new Random();
        x = rand.nextInt(ShootGame.background.getWidth() - width);//x坐标
    }


    @Override
    public int getScore()
    {
        return 5;
    }


    @Override
    public void step()
    {
        y += Yspeed;

    }


    @Override
    public boolean isShot(Bullet b)
    {
        return x < b.x && b.x < x + width && y < b.y && b.y < y + height;
    }
}
